i = 1;

while i<=length(time)
    sub5(i) = (sub1(i) + sub2(i) + sub3(i) + sub4(i))/4;
    
    i = i + 1;
end
plot(time, sub1, time, sub2, time, sub3, time, sub4, time, sub5)
hold on

legend('Subject 1', 'Subject 2', 'Subject 3', 'Subject 4', 'Average')
xlabel('Time (secs)')
title('MRI Cortex data with blue vertical lines indicating start and end')

line([36 36], [-0.5 1.5])
line([156 156], [-0.5 1.5])